package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.Setmeal;
import com.itheima.vo.SetmealVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface SetmealMapper extends BaseMapper<Setmeal> {

    @Select("select * from setmeal_t where id = #{setmealId}")
    public SetmealVO getInfo(@Param("setmealId") Long setmealId);

    @Select("select s.name,count(*) value from order_t o\n" +
            "left join setmeal_t s on s.id = o.setmeal_id\n" +
            "group by setmeal_id")
    public List<Map> selectSetmealPieData();

}
